<template>
	<view>
		<u-swiper :height="swiperHeight" indicatorMode="line" :list="list" @change="e => current = e.current"
			:autoplay="false">
			<view slot="indicator" class="indicator">
				<view class="indicator__dot" v-for="(item, index) in list" :key="index"
					:class="[index === current && 'indicator__dot--active']">
				</view>
			</view>
		</u-swiper>
	</view>
</template>

<script>
	export default {
		name: "index-swiper",
		data() {
			return {


				current: 0
			};
		},
		props: ['swiperHeight', "list"]
	}
</script>

<style lang="scss">
	.indicator {
		@include flex(row);
		justify-content: center;

		&__dot {
			height: 8rpx;
			width: 36rpx;
			border-radius: 100rpx;
			background-color: rgba(255, 255, 255, 0.35);
			margin: 0 5rpx;
			transition: background-color 0.3s;

			&--active {
				background-color: #ffffff;
			}
		}
	}

	.indicator-num {
		padding: 2rpx 0;
		background-color: rgba(0, 0, 0, 0.35);
		border-radius: 100rpx;
		width: 35rpx;
		@include flex;
		justify-content: center;

		&__text {
			color: #FFFFFF;
			font-size: 12rpx;
		}
	}
</style>